#ifndef __USART_H
#define __USART_H
#include "stdio.h"	
#include "sys.h" 

#define USART1_DMA_TX_LENGTH   		128
#define USART1_DMA_RX_LENGTH   		128

#define USART3_DMA_TX_LENGTH   		128
#define USART3_DMA_RX_LENGTH   		128

extern unsigned char usart1_tx_buffer[USART1_DMA_TX_LENGTH];
extern unsigned char usart1_rx_buffer[USART1_DMA_RX_LENGTH];

extern unsigned char usart3_tx_buffer[USART3_DMA_TX_LENGTH];
extern unsigned char usart3_rx_buffer[USART3_DMA_RX_LENGTH];
extern uint8_t usart3_sof_flag,usart3_rx_cnt;
extern volatile uint8_t usart3_len,usart3_rx_flag;
extern volatile uint8_t usart3_overtime_cnt;

extern volatile uint8_t usart1_len,usart1_rx_flag;

void usart1_init(uint32_t bound);
void USART1_DMA_Send(uint8_t *pbuffer, uint32_t size);
void send_data_dma_u1(uint8_t data[100],uint8_t num);
void u1_printf(char* fmt,...);
void usart3_init(uint32_t bound);
void USART3_DMA_Send(uint8_t *pbuffer, uint32_t size);
void send_data_dma_u3(uint8_t data[100],uint8_t num);
void u3_printf(char* fmt,...);
#endif


